<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:c="http://java.sun.com/jsf/core">

<head>
    <meta charset="UTF-8">
    <title>商家后台</title>
    <style>
        html {
            background: url(https://i02piccdn.sogoucdn.com/122644300e8e567f) no-repeat center center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
        }
    </style>
</head>
<body>
<div th:object="${session.merchant}">
    [ <span th:text="*{permission}"></span>:
    <span th:text="*{uname}"></span><br>
    账户:<span th:text="*{account}"></span>
    ]
    <a th:href="@{/page/login}">退出</a>
    <a th:href="@{/user/Login/(uname=${session.merchant.getUname()},pwd=${session.merchant.getPwd()})}">刷新</a>


</div>
<button id="toggle">添加菜单</button>
<div id="form">
    <form th:action="@{/Menu/addMenu/(user_name=${session.merchant.getUname()})}" method="post">
        商品名：<input type="text" name="name" id="name" required><br>
        价格：<input type="text" name="price" id="price" required><br>
        <select id="type" name="type">
            <option value="早餐">早餐</option>
            <option value="中餐">中餐</option>
            <option value="午餐">午餐</option>
            <option value="甜食">甜食</option>
            <option value="米">米</option>
            <option value="面">面</option>
        </select>
        <button  type="submit">提交</button>
    </form>
</div>
<div>
    <h3>在售菜品</h3>
    <table border="1">
        <thead>
        <tr>
            <th>商品名</th>
            <th>价格</th>
            <th>类型</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="menus:${menus}">
            <td th:text="${menus.getName()}"></td>
            <td th:text="${menus.getPrice()}"></td>
            <td th:text="${menus.getType()}"></td>
        <c:forEach var="list" items="${requestScope.list}">
            <td><a th:href="@{/Menu/delMenu/(id=${menus.getId()},user_name=${session.merchant.getUname()})}">下架</a></td>
        </c:forEach>
        </tr>
        </tbody>
    </table>
</div>
<div>
    <h3>未完成订单</h3>
    <table border="1">
        <thead>
        <tr>
            <th>用户名</th>
            <th>商品名</th>
            <th>价格</th>
            <th>类型</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="NOPayBill:${NOPayBill}">
            <td th:text="${NOPayBill.getUser_name()}"></td>
            <td th:text="${NOPayBill.getShopName()}"></td>
            <td th:text="${NOPayBill.getPrice()}"></td>
            <td th:text="${NOPayBill.getType()}"></td>
        </tr>
        <tr>
            <td th:text="'总价：'+${value}">value</td></tr>
        </tbody>
    </table>
</div>
<div>
    <h3>已完成订单</h3>
    <table border="1">
        <thead>
        <tr>
            <th>用户名</th>
            <th>商品名</th>
            <th>价格</th>
            <th>类型</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="PayedBill:${PayedBill}">
            <td th:text="${PayedBill.getUser_name()}"></td>
            <td th:text="${PayedBill.getShopName()}"></td>
            <td th:text="${PayedBill.getPrice()}"></td>
            <td th:text="${PayedBill.getType()}"></td>
        </tr>
        <tr>
            <td th:text="'总价：'+${value1}">value1</td></tr>
        </tbody>
    </table>
</div>

</body>
</html>